package com.dcrzl.gazgmh.module.common.mh.controller;

import com.dcrzl.gazgmh.common.entity.mh.MhContent;
import com.dcrzl.gazgmh.common.utils.PageInfo;
import com.dcrzl.gazgmh.common.utils.Result;
import com.dcrzl.gazgmh.module.mh.service.MhContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 
 *
 * @author dcrzl
 * @email 1728795786@qq.com
 * @date 2024-11-24 15:50:54
 */
@RestController
@RequestMapping("/common/mh/content")
public class CommonMhContentController {
    @Autowired
    private MhContentService mhContentService;

    /**
     * 列表
     */
    @GetMapping("/list")
    public Result<List<MhContent>> list(MhContent mhContent){
       return mhContentService.selectList(mhContent);
    }

    /**
    * 列表分页
    */
    @GetMapping("/page")
    public PageInfo<MhContent> page(MhContent mhContent){
        return mhContentService.selectUPage(mhContent);
    }

    /**
     * 信息
     */
    @GetMapping("/info/{id}")
    public Result<MhContent> info(@PathVariable("id") Long id){
		return mhContentService.selectById(id);
    }

    /**
     * 修改
     */
    @PutMapping("/update/can/num")
    public Result<Integer> updateCanNumById(@RequestBody MhContent mhContent){
        return mhContentService.updateCanNumById(mhContent);
    }

}
